package com.video.system.service.impl;

import java.util.List;
import com.video.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.video.system.mapper.VideoUserMapper;
import com.video.system.domain.VideoUser;
import com.video.system.service.IVideoUserService;

/**
 * 用户Service业务层处理
 * 
 * @author lyh
 * @date 2021-07-31
 */
@Service
public class VideoUserServiceImpl implements IVideoUserService 
{
    @Autowired
    private VideoUserMapper videoUserMapper;

    /**
     * 查询用户
     * 
     * @param uId 用户ID
     * @return 用户
     */
    @Override
    public VideoUser selectVideoUserById(Integer uId)
    {
        return videoUserMapper.selectVideoUserById(uId);
    }

    /**
     * 查询用户列表
     * 
     * @param videoUser 用户
     * @return 用户
     */
    @Override
    public List<VideoUser> selectVideoUserList(VideoUser videoUser)
    {
        return videoUserMapper.selectVideoUserList(videoUser);
    }

    /**
     * 新增用户
     * 
     * @param videoUser 用户
     * @return 结果
     */
    @Override
    public int insertVideoUser(VideoUser videoUser)
    {
        videoUser.setCreateTime(DateUtils.getNowDate());
        return videoUserMapper.insertVideoUser(videoUser);
    }

    /**
     * 修改用户
     * 
     * @param videoUser 用户
     * @return 结果
     */
    @Override
    public int updateVideoUser(VideoUser videoUser)
    {
        videoUser.setUpdateTime(DateUtils.getNowDate());
        return videoUserMapper.updateVideoUser(videoUser);
    }

    /**
     * 批量删除用户
     * 
     * @param uIds 需要删除的用户ID
     * @return 结果
     */
    @Override
    public int deleteVideoUserByIds(Integer[] uIds)
    {
        return videoUserMapper.deleteVideoUserByIds(uIds);
    }

    /**
     * 删除用户信息
     * 
     * @param uId 用户ID
     * @return 结果
     */
    @Override
    public int deleteVideoUserById(Integer uId)
    {
        return videoUserMapper.deleteVideoUserById(uId);
    }
}
